<template>
  <div class="home-container">
    <h1>欢迎参观我的商城</h1>
    <div class="links">
      <el-button type="primary" @click="$router.push('/login')" class="link-button">
        <i class="el-icon-user"></i> 登录
      </el-button>
      <el-button type="success" @click="$router.push('/adminlogin')" class="link-button">
        <i class="el-icon-s-custom"></i> 管理员登录
      </el-button>
    </div>
    <router-view></router-view>
  </div>
</template>

<style scoped>
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.home-container {
  text-align: center;
  padding: 40px;
  max-width: 800px;
  margin: 40px auto;
  background: linear-gradient(135deg, #ffcc99, #ffffff);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.home-container:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

body {
  font-family: 'Arial', sans-serif;
}

h1 {
  color: #333;
  margin-bottom: 30px;
  font-size: 2.5rem;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
  animation: fadeIn 1s ease forwards;
}

.links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
}

.link-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 1.1rem;
  border-radius: 8px;
  transition: background-color 0.3s ease, transform 0.3s ease;
  background: linear-gradient(135deg, #4caf50, #45a049);
  color: white;
  border: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  animation: fadeIn 1s ease forwards;
  animation-delay: 0.5s;
}

.link-button:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.link-button i {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.link-button:hover i {
  transform: rotate(360deg);
}

@media (max-width: 600px) {
  .home-container {
    padding: 20px;
  }

  h1 {
    font-size: 2rem;
  }

  .link-button {
    padding: 10px 18px;
    font-size: 1rem;
  }
}
</style>